#ifndef FACE_FEATURE_ARCFACE_GPU_H
#define FACE_FEATURE_ARCFACE_GPU_H

#include <iostream>
#include <string>
#include <opencv2/opencv.hpp>
#include <unistd.h>
// #include <omp.h>
#include "base_common/culab/split_channels.h"

#include "rt_model_operation.h"
#include <mutex>

using namespace algocommon;

namespace arcfacefeaturegpu
{




    struct InitParams: public OnnxModeltoTRTParam
    {
        int gpu_id;
        std::string onnx_model_path;
        std::string trt_model_dir;
        std::string trt_model_name;
    };



    class ArcfaceFeatureGpu : public OnnxModeltoTRT
    {
    public:

        ArcfaceFeatureGpu(const InitParams &params);

        virtual  ~ArcfaceFeatureGpu();
    
    
    public:
    
        std::pair<std::vector<float>, float>  Execute(const cv::Mat &img);
		std::vector<std::vector<float>> Execute(const std::vector<cv::Mat> &imgs);


    private:
        Result InitNetwork();

		void PreProcess(const cv::Mat &img);

		void PreProcess(const std::vector<cv::Mat> &imgs);        
        std::vector<float> PostProcess(std::vector<TensorFloat>&output_vectors);

		std::vector<std::vector<float>> BatchExecute(const std::vector<cv::Mat> &imgs);



    private:

        InitParams params_;
		std::mutex mutex_;

		TensorUint8 input_imgs_batch_syn_;

        float std_ = 0.5;
        float mean_ = 0.5;
        float norm_px_ = 255.0;


        std::vector<float> std_vec_ = {0.5, 0.5, 0.5};
        std::vector<float> mean_vec_ = {0.5, 0.5, 0.5};
    };
















}; //acfacefeaturegpu





















#endif